'''
@Company: TWL
@Author: xue jian
@Email: xuejian@kanzhun.com
@Date: 2020-02-03 15:15:46
'''
import xgboost as xgb
# read in data
dtrain = xgb.DMatrix('../data/agaricus.txt.train')
dtest = xgb.DMatrix('../data/agaricus.txt.test')
# specify parameters via map
param = {'max_depth':2, 'eta':1, 'objective':'binary:logistic' }
num_round = 2
bst = xgb.train(param, dtrain, num_round)
# print(bst)
# config = bst.save_config()
bst.save_model('test_model')
# print(config)
# make prediction
preds = bst.predict(dtest)
print(preds[:10])

